package com.dubbo;

/**
 * @author caoqianhuan
 * @date 2022/10/14
 * @Description: 实例初始化 和类初始化 辨析
 */
public class ClassAndInstanceInit {

}


class T {
    static {
        System.out.println("static 代码块");
    }

    {
        System.out.println("实例代码块");
    }

    protected static int t;

    protected static final int TT = 0;

    protected int k;

    public T () {
        System.out.println("T 构造方法");
    }

}

class TC extends T{
    static {
        System.out.println("TC static 代码块");
    }

    {
        System.out.println("TC 实例代码块");
    }

    protected static int tc;

    protected int kc;

    protected static final Integer TC_TC = 0;


    public TC() {
        System.out.println("TC 构造方法");
    }

}

class T_TEST {
    public static void main(String[] args) throws ClassNotFoundException {

        //System.out.println(TC.tc);

        //System.out.println(TC.TC_TC);

        //TC tc = new TC();

        Class.forName("com.dubbo.TC");
    }
}